import * as types from './mutation-types'

const mutations = {
    [types.SET_SCROLL_TO_LEFT](state) {
        state.scrollToLeft = new Date()
    },
    [types.EVAL_USER_MESSAGE](state, user) {
        if (user != null) {
            state.userMessage = user
            localStorage.setItem("userMessage", JSON.stringify(user))
            // sessionStorage.setItem("userMessage", JSON.stringify(user))
        } else if (user == null) {
            localStorage.setItem("userMessage", null)
            state.userMessage = null
        }
    }
}
export default mutations
